![]() |
PATH![]() |
![]() ![]() |
Uploads a file or directory synchronously to an FTP URL using a URL reference.
OSStatus URLUpload (
URLReference urlRef,
const FSSpec* source,
URLOpenFlags openFlags,
URLSystemEventProcPtr eventProc,
void* userContext);
The URLUpload function uploads data synchronously to the specified FTP URL from the specified file or directory and does not return until the upload is complete. The URLUpload function yields time to other threads. Your application should call URLUpload from a thread other than the main thread so that other processes have time to run.
If you want a progress indicator to be displayed during the upload, specify kURLDisplayProgressFlag in the openFlags parameter. The URL Access Manager uses a modal dialog box to display the progress indicator. If your application has multiple threads, it can call URLUpload multiple times, but if it calls URLUpload with kURLDisplayProgressFlag set in openFlags when the URL Access Manager is already displaying a modal dialog box, URLUpload returns the error kURLProgessAlreadyDisplayedError .
If the URL identified by the urlRef parameter is a file, the file is uploaded regardless of whether kURLDirectoryListingFlag or KURLIsDirectoryHintFlag is set in the openFlags parameter.
WARNING
Once you call URLUpload with urlRef , you cannot use the same urlRef to call URLUpload again, or to call URLDownlload or URLOpen . If you need to call URLUpload , URLDownload , or URLOpen with a urlRef that has already been used for one of these calls, you need to create a new URL reference by calling URLNewReference .
Call URLOpen if you need to control the upload process.